package model;

import java.util.ArrayList;
import java.util.List;
import org.jfree.ui.RefineryUtilities;
/**
 * 
 * @author Daranhdara Hun
 *
 */
public class PatientHealthHistory {
	List<TreatmentRecord> trList;

	public PatientHealthHistory(MedicalHistory mh)
	{
		this.trList = mh.getTreatmentRecords();
		
	}
	
	/**
	 * Creates line graph given variables assigned by constructor
	 * Auto creates all necessary frames and panels necessary for graph to show.
	 */
	public void makeGraph()
	{
		final XYSeriesDemo demo = new XYSeriesDemo("XY Series Demo",trList);
        demo.pack();
        RefineryUtilities.centerFrameOnScreen(demo);
        demo.setVisible(true);
	}
	  public static void main(final String[] args) {

	    	ArrayList<TreatmentRecord> temp = new ArrayList<TreatmentRecord>();
	    	TreatmentRecord t1 = new TreatmentRecord();
	    	t1.setWeight(20);
	    	TreatmentRecord t2 = new TreatmentRecord();
	    	t2.setWeight(10);
	    	temp.add(t1);
	    	temp.add(t2);
	    	
	        final XYSeriesDemo demo = new XYSeriesDemo("XY Series Demo",temp);
	        demo.pack();
	        RefineryUtilities.centerFrameOnScreen(demo);
	        demo.setVisible(true);

	    }
}
